package com.example.springbootdemo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * @Author: ShengXiaJia
 * @Date: 2019/12/4 10:13
 * @Description: 使用@ServletComponentScan注解后，Servlet、Filter、Listener可以直接通过@WebServlet、@WebFilter、@WebListener注解自动注册
 */

@SpringBootApplication
@ServletComponentScan
@MapperScan("com.example.springbootdemo.modules.*.dao")
public class AdminApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        //避免netty冲突,否则启动时elasticsearch会报错
        System.setProperty("es.set.netty.runtime.available.processors", "false");

        SpringApplication.run(CommonApplication.class, args);
        System.out.println("AdminApplication--------启动成功!");
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(CommonApplication.class);
    }

}
